/*
 * @Author: Aaron Huang
 * @Date: 2022-10-31 17:08:19
 * @LastEditors: Aaron Huang
 * @LastEditTime: 2022-11-01 14:34:08
 * @Description: file content
 * @FilePath: \ias_ui\src\views\coi\channelInventory\js\role.js
 * @Company: 沃尔玛
 */

export const hasPower = {
  data() {
    const administrationCode = ['R017001']
    const ECOperateCode = ['R017019']
    const roles = this.$route.meta.roles
    const otherRoleCode = roles?.filter(_ => !administrationCode.includes(_) && !ECOperateCode.includes(_)) || []
    return {
      isAdministration: this.hasRole(administrationCode),
      isECOperate: this.hasRole(ECOperateCode),
      hasAuthority: this.hasRole(otherRoleCode)
    }
  }
}
